<template>
  <div class="container">
    <!-- 顶部导航信息栏 -->
    <TopBar></TopBar>
    <!-- 搜索栏 -->
    <SearchBar></SearchBar>
    <!-- 筛选栏 -->
    <SchoolFilterBar @filter-changed="updateFilters"></SchoolFilterBar>
    <!-- 显示的任务 -->
    <SchoolShowTask :filters="filters"></SchoolShowTask>
    <!-- 底部导航信息栏 -->
    <BottomBar></BottomBar>

  </div>
</template>

<script>
import TopBar from "@/components/TopBar.vue";
import SearchBar from "@/components/SearchBar.vue";
import BottomBar from "@/components/BottomBar.vue";
import {ref} from "vue";
import SchoolShowTask from "@/components/SchoolShowTask.vue";
import SchoolFilterBar from "@/components/SchoolFilterBar.vue";

export default {
  name: "SchoolZonePage",  // 确保组件名一致
  components: {
    SchoolShowTask,
    SchoolFilterBar,
    TopBar,
    SearchBar,
    BottomBar
  },
  setup() {
    const filters = ref({
      category: '',
      region: '',
      paymentType: null,
      minPayment: null,
      maxPayment: null,
      unit: '天',
      groupType: null,
    });

    // 更新筛选条件
    const updateFilters = (newFilters) => {
      filters.value = { ...filters.value, ...newFilters };
      console.log("父组件收到筛选条件:", filters.value);
    };


    return {
      filters,
      updateFilters

    };
  },
};
</script>

<style scoped>
.container {
  position: absolute;
  width: 100%;
  height: 238.12vh;
  top: 0;
  left: 0;
  overflow-x: hidden; /* 禁止横向滚动条 */
  overflow-y: hidden;
  background: rgba(242, 244, 245, 1);
}

</style>
